/*MESSAGE start*/
var interval = setInterval(hideMessage, 5000);

function hideMessage() {
	var box = window.document.getElementById('message');
	box.style.display = "none";
	clearInterval(interval);
	interval = 0;
}

/*MESSAGE end*/

function empty(item) {
	if (item.value.length > 0) {
		return false;
	}
	item.focus();
	item.style.backgroundColor = "yellow";
	return true;
}

function kapcsolatCheck() {
	var form = document.forms[0];
	if (!empty(form.nev) && !empty(form.telefon) && !empty(form.email) && !empty(form.uzenet)) {
		return true;
	}
	return false;
}

/*MENU start*/
var opened = 0;
//var inter = 0;

function openSub(a) {
	closeSub();
	opened = a;
	a.style.display = "block";
	//	inter = setInterval(closeSub, 3000);
}

function closeSub() {
	if (opened !== 0) {
		opened.style.display = "none";
		opened = 0;
	}

	/*	if(inter!==0){
	 clearInterval(inter);
	 inter = 0;
	 }
	 */
}

/*MENU end*/

/* Social buttons */
function inFacebook() {
	$("#social #fb").animate({
		width : '+=100'
	}, '50');
	$("#social #sf").animate({
		width : '100',
		opacity : '1',
		paddingLeft : '24',
		paddingRight : '15'
	}, '50');
}

function outFacebook() {
	$("#social #fb").animate({
		width : '-=100',
	}, '50');
	$("#social #sf").animate({
		width : '24',
		opacity : '0',
		paddingLeft : '0',
		paddingRight : '0'
	}, '50');
}

function inTwitter() {
	$('#social #tb').animate({
		width : '+=100'
	}, '50');
	$('#social #st').animate({
		width : '100',
		opacity : '1',
		paddingLeft : '24',
		paddingRight : '15'
	}, '50');
}

function outTwitter() {
	$('#social #tb').animate({
		width : '-=100'
	}, '50');
	$('#social #st').animate({
		width : '24',
		opacity : '0',
		paddingLeft : '0',
		paddingRight : '0'
	}, '50');
}

function inGoogle() {
	$('#social #gb').animate({
		width : '+=100'
	}, '50');
	$('#social #sg').animate({
		width : '100',
		opacity : '1',
		paddingLeft : '24',
		paddingRight : '15'
	}, '50');
}

function outGoogle() {
	$('#social #gb').animate({
		width : '-=100'
	}, '50');
	$('#social #sg').animate({
		width : '24',
		opacity : '0',
		paddingLeft : '0',
		paddingRight : '0'
	}, '50');
}